UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DG4D3ktJf3tr2scYNBncvgIa9EgvreRWve8YRZfm1KQ=' 
WHERE 
  key_id = '5e297cb8db26faf2a4d3937fb514baefe005208a5a68c610e1958d4f62ccf392' 
  AND (
    token = 'DG4D3ktJf3tr2scYNBncvgIa9EgvreRWve8YRZfm1KQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019