UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Py8CmIojvXeE3rUp3r/DTDqJnJLyhO4Uv5qSKUU5u6Q='
WHERE
key_id = 'e246728b11ef9e6fea9006094c6e91889f368f2713f52008279bbd96da230dba'
AND (
token = 'Py8CmIojvXeE3rUp3r/DTDqJnJLyhO4Uv5qSKUU5u6Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)