UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9ypMV0riTr1CGEdAHiyhpiIkppODJ/upjTSGQW1v5WY=' 
WHERE 
  key_id = '052e2525205bebecdc821a9d3588fb7eb1008fcf3eac34f74b296b545e1f16b9' 
  AND (
    token = '9ypMV0riTr1CGEdAHiyhpiIkppODJ/upjTSGQW1v5WY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022