UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '43yryYoXwhg7dIXMi8VX5w0YbGWbNA6jg7iLCgaryVQ='
WHERE
key_id = '8ea829f96965add6ab95385962ef215ae077071b5b10fe6de35078b0e4a9d931'
AND (
token = '43yryYoXwhg7dIXMi8VX5w0YbGWbNA6jg7iLCgaryVQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)