UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QWaw6WRLAu7DiGdmtm07+8Tp1oL7bGrOT0YvA0yvfos='
WHERE
key_id = '70a3f82e9ebbfed6fbc5dfe2d5e91a28da2417fbd4747515e8cbe036919fa86c'
AND (
token = 'QWaw6WRLAu7DiGdmtm07+8Tp1oL7bGrOT0YvA0yvfos='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)