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

Query time 0.00027