UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7/B7fc8ECv0ZTnpMgzZ/821Pzlt/mzXAxBQT0udGSII='
WHERE
key_id = '48ca01a8833239706bf0190313b6c91a91ffbef4e4d93f741f966614334d9127'
AND (
token = '7/B7fc8ECv0ZTnpMgzZ/821Pzlt/mzXAxBQT0udGSII='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)