UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tbdo8kTX7VS3C6x2qeHJvaaBUyesE+Af8pvhqa3FWJs=' 
WHERE 
  key_id = '77f76f57ba62f17a0ba16463e247939a899b04d5527ae9fa4c417ee16d1eb443' 
  AND (
    token = 'tbdo8kTX7VS3C6x2qeHJvaaBUyesE+Af8pvhqa3FWJs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00060