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