UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hK77Isky6lrj9XMK0BR5bp2gR5MUy6HkeUuUTQoWQ0s='
WHERE
key_id = 'f1a99ba6e6620d30650c696caa9943d00bf09a2cbfd0feb2f533074bd49f75c6'
AND (
token = 'hK77Isky6lrj9XMK0BR5bp2gR5MUy6HkeUuUTQoWQ0s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)