UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xYtsZ0fHSJmpBPdBMVUjVNLT0kVbNTztr9ukFM+fsLo='
WHERE
key_id = '8017047536d86a27f1bbfc0917577cb4e5e9c4cb0ed51ef847bd18e5fb1e13fc'
AND (
token = 'xYtsZ0fHSJmpBPdBMVUjVNLT0kVbNTztr9ukFM+fsLo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)