UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TPDF+nHcolF0qtVrxhMx/Fr8MdZDv4kD0r2ZK2itHIs='
WHERE
key_id = 'b5ad18e57c22ca7f087edfa95b8cc2dddc4e37b89c68558266d0e05f53af273f'
AND (
token = 'TPDF+nHcolF0qtVrxhMx/Fr8MdZDv4kD0r2ZK2itHIs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)