UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Tf4Kj5Ldnmv53jTT+O7Qk10EIQ3X+pprT4vxlOXaDIc='
WHERE
key_id = '47709adfcad10cd3cd9b21720e1fc08a02b4d3b2742c88725144ac3f7e10bcd6'
AND (
token = 'Tf4Kj5Ldnmv53jTT+O7Qk10EIQ3X+pprT4vxlOXaDIc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)