UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LRKxM9IuxB7TWpO+O8Z2SA3Z6IEg9d0qxPghDyBFM9k=' 
WHERE 
  key_id = '71a9f4cb2874cdaf7ccbe12b82b1defe017f68d2ba0660daa821cf9d30d6e709' 
  AND (
    token = 'LRKxM9IuxB7TWpO+O8Z2SA3Z6IEg9d0qxPghDyBFM9k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040