UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'b7xE1QGrhiyHwYgAc7Lq52o0aI6IMpXB/VDgYHKslVg='
WHERE
key_id = '41fc28356d430ac7250301e615925686e1317eb9c79db945d0d4d5e6fd27abb0'
AND (
token = 'b7xE1QGrhiyHwYgAc7Lq52o0aI6IMpXB/VDgYHKslVg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)