UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9ZWuw5pCAKi1g4NtCNyOxsHaLWiVAsr/gSj0e2LMRa4=' 
WHERE 
  key_id = 'f5a332bfcb19eaa87727efbf3ba50d47f81afeae734a49928fbd939acfdb5f97' 
  AND (
    token = '9ZWuw5pCAKi1g4NtCNyOxsHaLWiVAsr/gSj0e2LMRa4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038