UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'v355lMdXoA35ur1RHRnT71e7ysEbWmFBRRDAgF5e4X0='
WHERE
key_id = 'eb54de32c09445bb58aec3ad221836234f74be467cbd3016df6823b7f6f47ddf'
AND (
token = 'v355lMdXoA35ur1RHRnT71e7ysEbWmFBRRDAgF5e4X0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)