UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eBMzWopdwQxDRd+hvCwokirSkNtzgDfBSfpo8Yv4uVA='
WHERE
key_id = 'e4800a7bd7d44ec53fc0e77413dffe2ef72aff0b887d1d50c429b337db73f625'
AND (
token = 'eBMzWopdwQxDRd+hvCwokirSkNtzgDfBSfpo8Yv4uVA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)