UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lyernBeSYEmLDVZ5a5YpVgTrrMa/WKlrtS69C3vy/a0='
WHERE
key_id = 'c92bbadf91f10501dd16c7de55ef1fb071fefb307b1047cc3682c8ad4c5717e5'
AND (
token = 'lyernBeSYEmLDVZ5a5YpVgTrrMa/WKlrtS69C3vy/a0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)