UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fHw95q9qbdrgbaZsvTihuR/Jvr6xaXs7KkSHjJOj+xY=' 
WHERE 
  key_id = '57493bf9ab8d9df56680d2d98f92ccb66b5ff8df7bad054e60306a552a05960f' 
  AND (
    token = 'fHw95q9qbdrgbaZsvTihuR/Jvr6xaXs7KkSHjJOj+xY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032