UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1xRY4VL316/zgCi7AkQwLySt+UjSsx+M2XKeDy70bc4=' 
WHERE 
  key_id = '7f4d1b94ff3370e0a2ef603c4138d7f0ecae6cf176a080faeb33ca8876b350d3' 
  AND (
    token = '1xRY4VL316/zgCi7AkQwLySt+UjSsx+M2XKeDy70bc4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031