UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YRr4Xk2RtchNdvrMcKfBM2XWljkD5Mk7d5j0b6HEUxg=' 
WHERE 
  key_id = 'a542e2b929607119ab0229ec79e9f4dbab06bdea928333c21f25e2d67988818d' 
  AND (
    token = 'YRr4Xk2RtchNdvrMcKfBM2XWljkD5Mk7d5j0b6HEUxg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029