UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'i9otMv94WHdtcT/kRvVxDxXP4ojFxSdLnZ20yBO6N58=' 
WHERE 
  key_id = '5aab8812980f216fc23b0876b66d7b252fb8fa2722ce3c29717a937c1cc9bbda' 
  AND (
    token = 'i9otMv94WHdtcT/kRvVxDxXP4ojFxSdLnZ20yBO6N58=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016