UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'l41UV4cLd+TZoqvZC4hz8/M2UsZEOed/CEwTMdqKKhs='
WHERE
key_id = 'eefbed19fe5b201302315257736518e63ce31e7f4fb70aba5ee93e653e50cd81'
AND (
token = 'l41UV4cLd+TZoqvZC4hz8/M2UsZEOed/CEwTMdqKKhs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)