UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3XEdFOUObJEvxogNMhSsPH7RYzL+H1cSLApTWtwrLUE='
WHERE
key_id = '0b15212c244d878a4861161c3811c7d3f4f410460ba0830629dcc860c7081e28'
AND (
token = '3XEdFOUObJEvxogNMhSsPH7RYzL+H1cSLApTWtwrLUE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)