UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+eChBt11biXW4CQf3TAvPmwMfYny/8L4ZRnV53+qX2Q=' 
WHERE 
  key_id = '38d8f7d4749b9974496735ba27ebc1a0559cfc6c104360db49cb08f9dfefbc51' 
  AND (
    token = '+eChBt11biXW4CQf3TAvPmwMfYny/8L4ZRnV53+qX2Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035