UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'D6NkbDbsn+NPrYms2vbe4GkC2d/H2DLwvdBbZgbxQ0I='
WHERE
key_id = '417f8d47b883bb197a2e8ed05ecd2e4bb80ecc634b7d2362ef9842ef5b4336fe'
AND (
token = 'D6NkbDbsn+NPrYms2vbe4GkC2d/H2DLwvdBbZgbxQ0I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)