UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bo0VjqjjANnAVoGCd4+KgbMYoweue5uQbs61N5g86Ec='
WHERE
key_id = '4d23a931cab8121e98e5bfc5eb0ed9d3878e2bcf633bf109292afce826f07009'
AND (
token = 'bo0VjqjjANnAVoGCd4+KgbMYoweue5uQbs61N5g86Ec='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)