UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GGd+nVmIYRC/z4dmvdqxuxHdkFffXpmBDDd4UGR/YJs='
WHERE
key_id = 'dea76851682e0283ab0d4a0296525f913081f91c59a95e8d37677e7774d1ae7a'
AND (
token = 'GGd+nVmIYRC/z4dmvdqxuxHdkFffXpmBDDd4UGR/YJs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)