UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fh4gA8N6QwFxl/c67RabhyJZaj5ZYYObaVkTCgp5wxc=' 
WHERE 
  key_id = '0d0523a5bbeb27c53f1ea8a1147ff19aeb8cabda767cd8301ae11ed949e30bde' 
  AND (
    token = 'fh4gA8N6QwFxl/c67RabhyJZaj5ZYYObaVkTCgp5wxc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017