UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WjRpZMBzh/F9Veua7jCpb6rytkQ3tyKNvFM2HCd7HGE='
WHERE
key_id = '960788d8aa677c1f383c5de5b240835c301603a3824fe69f6f675fa02451a69f'
AND (
token = 'WjRpZMBzh/F9Veua7jCpb6rytkQ3tyKNvFM2HCd7HGE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)