UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3DXESfF71UBndfOw8utOg6vXocrg7N4VC/OJqdIctD0=' 
WHERE 
  key_id = '8ceab651cd9b1cb9e4d25c9d00342f857f4346a7b6400588b10434ad64338946' 
  AND (
    token = '3DXESfF71UBndfOw8utOg6vXocrg7N4VC/OJqdIctD0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044