UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'XzhH+KASMvjVp7Hp4uR5A78d93zj80leD4V3R7urBjE=' 
WHERE 
  key_id = 'ac3429aee8577fd4fdc8e5fe9dbbdd2dba13462aac9cd86294b30980eb55375b' 
  AND (
    token = 'XzhH+KASMvjVp7Hp4uR5A78d93zj80leD4V3R7urBjE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020