UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oi0NuubFD2syjPL7UDHSpAq36Xber3IIuAXtD1WL/x0='
WHERE
key_id = '50dd06f410d8791948c8e1d4c6dde4a481f3dfc72f66bf965a1630476ff072fb'
AND (
token = 'oi0NuubFD2syjPL7UDHSpAq36Xber3IIuAXtD1WL/x0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)