UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0+GgJbMiwWpB3KlKh+rxt4Zlujwi5JxjWfeJZY6WSKs='
WHERE
key_id = '9956c5797161d3be49d39b9c962da3495db52dce9e0abc900ebec0d68dcb62ec'
AND (
token = '0+GgJbMiwWpB3KlKh+rxt4Zlujwi5JxjWfeJZY6WSKs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)