UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rMdfjhbhGEGank6X5YF/Dh4fZvpnlh0c7OEVqI8ulVY=' 
WHERE 
  key_id = '8212f326f599d14438780fe8572226f2557f457ac6a5e9b8c776f175704ff4f5' 
  AND (
    token = 'rMdfjhbhGEGank6X5YF/Dh4fZvpnlh0c7OEVqI8ulVY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032