UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'AxXD9cblEmiAfqoFKVBAEhhVU+xHpOwVQJV255Oyq+s=' 
WHERE 
  key_id = '701f47ba36dfc37f7e7cec724968a8db8587fb2fe68064ecf0e868383c5c60a6' 
  AND (
    token = 'AxXD9cblEmiAfqoFKVBAEhhVU+xHpOwVQJV255Oyq+s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038